package com.magold.start.credits;

import org.andengine.entity.particle.emitter.IParticleEmitter;
import org.andengine.entity.shape.IAreaShape;

public class AreaShapedEmitter implements IParticleEmitter {
	private IAreaShape mShape;
	
	public AreaShapedEmitter(IAreaShape mShape) {
		this.mShape = mShape;
	}

	@Override
	public void onUpdate(float pSecondsElapsed) {
	}

	@Override
	public void reset() {
	}

	@Override
	public void getPositionOffset(float[] pOffset) {
		float x = mShape.getX(), y = mShape.getY();
		float w = mShape.getWidth(), h = mShape.getHeight();
		pOffset[0] = x + (float) Math.random()*w;
		pOffset[1] = y + (float) Math.random()*h;
	}

}
